package com.cskaoyan.bean.wx_home_index;

import com.cskaoyan.bean.goods.MarketGoods;
import com.cskaoyan.bean.market.Category;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @Author: WD created on 2021-09-18 17:10
 * @Version:
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class InnerFloorGoods {

    private String name;
    private List<InnerFloorGoodsInnerGoods> goodsList;
    private Integer id;

    public InnerFloorGoods(Category category, List<MarketGoods> goods) {
        this.id = category.getId();
        this.name = category.getName();
        List<InnerFloorGoodsInnerGoods> innerGoods = new ArrayList<>();
        for (MarketGoods good : goods) {
            innerGoods.add(new InnerFloorGoodsInnerGoods(good));
        }
        this.goodsList = innerGoods;



    }
}


